#include <xp/msw/scm.h>
#include <xp/bas/stdio.h>
#include <xp/bas/time.h>

int xp_main (int argc, xp_char_t* argv[])
{
	xp_scm_t scm;
	xp_svcstatus_t status;

	
	if (xp_scm_open(&scm, XP_NULL) == XP_NULL) {
		xp_fprintf (xp_stderr, XP_TEXT("cannot open scm\n"));
		return -1;
	}


	if (xp_scm_createsvc (&scm, argv[1], argv[2], XP_SVC_KERNEL_DRIVER, XP_SVC_DEMAND_START) == -1)
	{
		if (xp_scm_geterrnum(&scm) != XP_SCM_ENOACT) {
			xp_fprintf (xp_stderr, 
				XP_TEXT("cannot create service - %s\n"), 
				xp_scm_geterrstr(&scm));
			return -1;
		}
	}

	xp_scm_close (&scm);
	return 0;
}
